package com.dragon.test.dao.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Repository;

import com.dragon.test.bean.Person;
import com.dragon.test.dao.IPersonDao;

@Repository
public class PersonDaoImpl implements IPersonDao {

	@Autowired
	JdbcTemplate template;

	@Override
	public int add(Person person) {
		String sql = "insert into person (id,name,sex,phone) values(default,?,?,?)";
		int update = template.update(sql, person.getName(), person.getSex(), person.getPhone());
		System.out.println("插入数据。。。【" + person + "】");
		int i = 10 / 0;
		return update;
	}

}
